package com.xx.job.seatastorageservice2002.Controller;

import com.xx.job.common.CommonResult;
import com.xx.job.entity.Storage;
import com.xx.job.seatastorageservice2002.service.StorageSerivce;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class StorageController {

    @Autowired
    private StorageSerivce storageSerivce;
    // 127.0.0.1:2003/storage/update?commodityCode=001&count=1
    @RequestMapping("/storage/update")
    public CommonResult update(@RequestBody Storage storage){
        storageSerivce.update(storage);
        return new CommonResult(200,"更新库存成功");
    }
}
